import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/login',
    // component: Home
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/pages/login.vue')
  },
  {
    path: '/manager',
    name: 'Manager',
    redirect: '/manager/home',
    component: () => import('@/pages/manager.vue'),
    children: [
      {
        path: 'home',
        name: 'Home',
        component: () => import('@/pages/home.vue')
      },
      {
        path: 'order',
        name: 'Order',
        component: () => import('@/pages/order.vue')
      },
      {
        path: 'income',
        name: 'income',
        component: () => import('@/pages/income.vue')
      },
      {
        path: 'user',
        name: 'User',
        component: () => import('@/pages/user.vue')
      },
      
      
      // {
      //   path: '/about',
      //   name: 'About',
      //   // route level code-splitting
      //   // this generates a separate chunk (about.[hash].js) for this route
      //   // which is lazy-loaded when the route is visited.
      //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
      // }
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
